package org.example;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;
import java.net.URISyntaxException;

/**
 * 文件的下载
 */
public class HdfsClientDownload {


    public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException {

        String pathLocal = HdfsClientDownload.class.getClassLoader().getResource("").getPath();


        try (FileSystem fs = HadoopConnectUtil.getFileSystem()) {
            fs.copyToLocalFile(
                    false, // 服务器上的文件下载之后是否删除
                    new Path("/xiyou/huaguoshan"),
                    new Path( "/Users/fengliulin/Documents/xiazai"),
                    false // false 开启crc校验, true,不开启
            );

        }
    }
}